﻿<UserControl x:Class="PasswordSafe.UserControls.ChangePassword" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:odc="clr-namespace:Odyssey.Controls;assembly=Odyssey" xmlns:local="clr-namespace:PasswordSafe.Controls" VerticalAlignment="Stretch"
        HorizontalAlignment="Stretch" xmlns:conv="clr-namespace:PasswordSafe.Converter" x:Name="lock" xmlns:uc="clr-namespace:PasswordSafe.UserControls"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" MinHeight="220">
    <Grid TextBlock.FontSize="12">
        <Grid VerticalAlignment="Top" HorizontalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="100" />
            </Grid.ColumnDefinitions>
            <TextBlock Text="PasswordSafe - Change Password" Margin="16,3,16,2" VerticalAlignment="Top" Grid.Column="0" HorizontalAlignment="Center"
                    FontSize="12" FontWeight="Bold" IsHitTestVisible="False"/>
        </Grid>
        <Grid VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,10,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Grid.ColumnSpan="2" Text="Change Password" HorizontalAlignment="Center" Margin="4,4,4,10" FontSize="18" />

            <TextBlock Grid.Row="1" Text="Old Password" Margin="4,2,4,2" HorizontalAlignment="Right" VerticalAlignment="Center" />
            <TextBlock Grid.Row="2" Text="New Password" Margin="4,2,4,2" HorizontalAlignment="Right" VerticalAlignment="Center" />
            <TextBlock Grid.Row="3" Text="Confirm Password" Margin="4,2,4,2" HorizontalAlignment="Right" VerticalAlignment="Center" />
            <PasswordBox Grid.Row="1" Grid.Column="1" Width="240" Margin="2" VerticalAlignment="Center" x:Name="oldPassword" MinHeight="24"
                    VerticalContentAlignment="Center" />
            <PasswordBox Grid.Row="2" Grid.Column="1" Width="240" Margin="2" VerticalAlignment="Center" x:Name="newPassword" MinHeight="24"
                    VerticalContentAlignment="Center" />
            <PasswordBox Grid.Row="3" Grid.Column="1" Width="240" Margin="2" VerticalAlignment="Center" x:Name="confirmPassword" MinHeight="24"
                    VerticalContentAlignment="Center" />

            <Button Grid.Row="4" Grid.Column="1" Focusable="False" HorizontalAlignment="Right" Margin="4"
                    Command="{x:Static uc:ChangePassword.ChangePasswordCommand}">
                <Button.Template>
                    <ControlTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Change" Margin="4,2,4,2" VerticalAlignment="Center" x:Name="changeTxt"
                                    Foreground="{DynamicResource {ComponentResourceKey odc:Skins, WindowForegroundBrush}}" />
                            <Image Width="24" Height="24" x:Name="img" Source="/img/arrow_right_24.png" RenderOptions.BitmapScalingMode="NearestNeighbor"
                                    RenderOptions.EdgeMode="Aliased" />
                        </StackPanel>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Source" Value="/img/arrow_right_24_h.png" TargetName="img" />
                            </Trigger>
                            <Trigger Property="Button.IsPressed" Value="True">
                                <Setter Property="Source" Value="/img/arrow_right_24_p.png" TargetName="img" />
                            </Trigger>
                            <Trigger Property="Button.IsEnabled" Value="False">
                                <Setter Property="Source" Value="/img/arrow_right_24_d.png" TargetName="img" />
                                <Setter Property="Foreground" Value="Gray" TargetName="changeTxt" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Button.Template>
            </Button>
            <Button Grid.Row="5" Grid.ColumnSpan="2" HorizontalAlignment="Center" Padding="4,0,4,0" Content="Back to Login" Click="OnBackToLoginClick"
                    FontSize="11" Margin="0,15,0,0" />
        </Grid>

    </Grid>
</UserControl>
